home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / batchfactory / scripts / opalpaint / opal_add_gradual_brilliance next >
Encoding:
Text File  |  1995-01-12  |  2.4 KB  |  92 lines

  1. /* 
  2.                         OPAL ADD GRADUAL BRILLIANCE
  3.                                By J.L. White
  4.                           ©1994 Merlin's Software
  5.  
  6.  Apply Brilliance -50 to 0 to 50 To A Sequence Of Images Gradually Over Time
  7.                              Opal Paint Script
  8.  
  9.  Batch Factory Batch Conversion Scripts are basically Arexx scripts that
  10. allow you to pass certain parameters to the external program you wish
  11. to use to convert the images from one format to another. You can pass
  12. five different strings from Batch Factory to the script by using the
  13. following commands:
  14.  
  15. $N = This will pass the current selected filename.
  16. $P = This will tell Batch Factory to ask for a path to save new frames to.
  17. $# = This will pass the current frame number in the script.
  18. $T = This will pass the total number of frames in the script.
  19. $A = This will pass an offset number to be used to save frames with.
  20.  
  21. NOTE: The following line is required to work as a Batch Factory Script:
  22.  
  23. PARSE=$N $P $# $A $T
  24.  
  25. */
  26.  
  27. options results
  28. call Locate_OpalPaint
  29. address "OpalPaint_Rexx"
  30.  
  31. arg InPic OutPic FrameNum AddNum TotalNum
  32. SaveNum = FrameNum + AddNum
  33.  
  34. if FrameNum = 1 then do
  35.     SaveSetUp
  36.         SetPrefs 1024
  37.         AskBool "Select Save Format You Wish To Use?\n\n        Select [OK] For IFF \n\n     Select [CANCEL] For JPEG"
  38.     if Result=0 then do
  39.         AskProp 1 100 84 "Enter JPEG Compression Value (1 - 100)!"
  40.         Format = JPEG Result
  41.         end
  42.     else
  43.         Format = IFF
  44.         Saver Format
  45.     ActivePot 1
  46.         AskBool "Select Gradual Direction?\n\nSelect [OK] For UP \n\nSelect [CANCEL] For DOWN"
  47.     if Result=0 then 
  48.         Direction = "UP"
  49.     else
  50.         Direction = "DOWN"
  51.     call open TempFile,"Ram:OAGC",W
  52.     call writeln TempFile,Direction
  53.     call close TempFile
  54.     end
  55. else do
  56.     call open TempFile,"Ram:OAGC",R
  57.     line = readln(TempFile)
  58.     parse var line Direction
  59.     call close TempFile
  60.     end
  61. if FrameNum = TotalNum then do
  62.     address command "delete >NIL: Ram:OAGC"
  63.         end
  64.  
  65. Load InPic
  66. Num = ((FrameNum * 50)/(TotalNum))
  67. if Direction = "UP" then
  68.     SetDrawMode 8 Num
  69. else
  70.     SetDrawMode 8 0-Num
  71. if FrameNum > 1 then Zap
  72.  
  73. if OutPic = "SAME" then
  74.     Save InPic
  75. else
  76.     Save OutPic""right(SaveNum,3,0)
  77. if FrameNum = TotalNum then do
  78.     RestoreSetUp
  79.     address command "delete >NIL: ram:OPSI"
  80.     Key "AMIGA w"
  81.     address command "wait 1"
  82.     end
  83. exit
  84.  
  85. Locate_OpalPaint:
  86.     if (POS('OpalPaint_Rexx',SHOW('Ports')) = 0)
  87.     then do
  88.         address command 'run < nil: > nil: OpalPaint:OpalPaint -q'
  89.         address command 'wait 5'
  90.     end
  91. return
  92.